package com.example.waterme.worker

import android.content.Context
import androidx.work.CoroutineWorker
import androidx.work.WorkerParameters
import com.example.waterme.PLANT_NAME_KEY
import com.example.waterme.R

class WaterWorker(ctx: Context, params: WorkerParameters) : CoroutineWorker(ctx, params) {
    override suspend fun doWork(): Result {
        val plantName = inputData.getString(PLANT_NAME_KEY)
        makeStatusNotification(applicationContext.getString(R.string.time_to_water, plantName), applicationContext)
        return Result.success()
    }
}